package com.mars.mapper;

import com.mars.Bean.User;
import org.mybatis.spring.SqlSessionTemplate;


public class UserMapperImpl implements UserMapper{
    //我们的所有操作，原来都使用sqlSession，现在都是用sqlSessionTemplate

    private SqlSessionTemplate sqlSessionTemplate;

    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        this.sqlSessionTemplate = sqlSessionTemplate;
    }

    @Override
    public User selectUsers(int id) {
        UserMapper userMapper = sqlSessionTemplate.getMapper(UserMapper.class);
        return userMapper.selectUsers(id);
    }

}
